<!DOCTYPE >
<html lang="zh-cn">
  <head>
    <title>后台管理-功能</title>
    <% include ../partials/head %>
    <script type="text/javascript">
      var oReply ={
            operator:function(){
                $("#certain_feedback").on('click',function(){
                    $this = $(this)
                    if(window.confirm('你确定回复该用户么？')){
                        $.post("/admin/feedback/handler",{
                            "userId":$this.attr('userId'),
                            "feedbackId":$this.attr("feedbackId"),
                            "content":$("#feedback_content").val()
                        },function(json){
                            if(json.code==0){
                                alert("发送成功");
                                $this.parents('tr').remove();
                            }else{
                                alert(json.msg);
                            }
                        },'json');
                    }else{
                        //取消
                    }
                })
            },
            init:function(){
                this.operator();
            }
        }
        $(document).ready(function(){
            oReply.init();
        })
    </script>
  </head>

  <body>
    <header>
      <% include ../partials/header %>
    </header>
    <div class="ch-container">
      <div class="row">
        <% include ../partials/sidebar %>
        <!-- 页面内容 -->
        <div id="content" class="col-lg-10 col-sm-10">
          <div class="row">
            <ul class="breadcrumb">
              <li>
                  <a href="/admin/feedback">反馈列表</a>
              </li>
              <li>
                  <a href="">处理</a>
              </li>
            </ul>
          </div>

          <div class="row">
            <div class="box col-md-12">
              <div class="box-inner">
                <div class="box-header well" data-original-title="">
                  <h2><i class="glyphicon glyphicon-edit"></i> 反馈回复 </h2>
                </div>

                <% if (typeof feedback != "undefined") { %>
                <div class="box-content">

                  <div class="form-group">
                    <label for="exampleInputEmail1">用户:&nbsp&nbsp&nbsp <%= feedback.get("user")? feedback.get("user").get("nickname"): "" %></label>
                  </div>
                  <div class="form-group">
                    <label for="exampleInputEmail1">建议:&nbsp&nbsp&nbsp <%= feedback.get("advise") %></label>
                  </div>

                    <div class="form-group">
                        <label for="exampleInputEmail1">回复</label>
                        <textarea id="feedback_content" rows="5" class="form-control"></textarea>
                    </div>
                    <button id="certain_feedback" feedbackId=<%=feedback.id%> userId=<%= feedback.get("user").id%> class="btn btn-success"><i class="glyphicon glyphicon-shopping-cart"></i>
                        确定</button>

                </div>
                <% } %>

              </div>
            </div>
          </div>
        </div>
      </div>
      <% include ../partials/footer %>
    </div>
    <% include ../partials/external %>
  </body>
</html>
